<!DOCTYPE html PUBLIC "-//W3C//Dth XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/Dth/xhtml1-transitional.dth">
<!--#include file="DataLoad.asp"-->

<html>
<head>
<title><%=GuildName%> - DKP系统</title>
<script language="JavaScript" src="inc/jquery.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="Generator" content="EditPlus">
<meta name="Author" content="SULei">
<meta name="Keywords" content="DKP WOW GUILD">
<meta name="Description" content="">
<link href="<%=StylePath%>/main.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="<%=StylePath%>/styleplus.js"></script>
<style type="text/css" media="all">

</style>
</head>

<body>
<div class="header">
<!--#include file="menu.asp"-->
</div>
<div class="main">

<!-- <textarea class="hi" style="width:550px;height:300px;"></textarea> -->

<%
if IsNumeric(request.form("filter")) and request.form("filter")<>"" then
	Response.redirect "?id="&request.form("filter")
	Response.end
end if

Dim base_dkp,tdkp,player_name,player_log
tdkp=0
if IsNumeric(request("id")) then
	Call PlayerBaseInfo()
	Call Looted()
	Call SpecEvent()
	Call PlayerDetail()
end if
%>

</div>
<div id="footer"><!--#include file="footer.asp"--></div>


			<script language="JavaScript">
				var charXml = $();
				var itemXml = $();
				var armoryFacepicURL = "<%=armoryFacepicURL%>";
				var strcharName = "<%=Server.URLEncode(player_name)%>";
				var strServerName = "<%=Server.URLEncode(GuildServer)%>";
				$.get("GetArmory.asp", { server: strServerName ,mode:"1" ,sname: strcharName },
				  function(data){
					//$("textarea.hi").text(data);
					charXml = $("<xml>" + data + "</xml>");
					var facecode = $("character",charXml).attr("genderId") + "-" + $("character",charXml).attr("raceId") + "-" + $("character",charXml).attr("classId")
					//$genderId}-{$raceId}-{$classId} 头像命名格式
					if ($("character",charXml).attr("class"))
					{
					$(".ArmoryCharFrame .face img").attr("src","http://cn.wowarmory.com/images/portraits/wow-70/" + facecode + ".gif");

					$(".ArmoryCharFrame span[name=GuildName]").text($("character",charXml).attr("guildName"));

					$(".ArmoryCharFrame span.level").text($("character",charXml).attr("level"));
					$(".ArmoryCharFrame span.xclass").text($("character",charXml).attr("class"));
					$(".ArmoryCharFrame span.talent").text($("talentSpec",charXml).attr("treeOne") + "/" + $("talentSpec",charXml).attr("treeTwo") + "/" + $("talentSpec",charXml).attr("treeThree"));

					$(".ArmoryCharFrame span.skill1").text($("professions skill:eq(0)",charXml).attr("name"));
					$(".ArmoryCharFrame span.skill2").text($("professions skill:eq(1)",charXml).attr("name"));

					$(".ArmoryCharFrame span.hp").text($("health",charXml).attr("effective"));
					$(".ArmoryCharFrame span.mp").text($("secondBar",charXml).attr("effective"));
					} else { $(".ArmoryCharFrame span[name=GuildName]").text("未能获取Armory数据"); }
					
					for ( i = 0; i < 17 ; i ++ ) {
						if ($("item[slot="+ i +"]",charXml).attr("icon"))
						{
							$(".ArmoryCharFrame img[name=eq"+ (i+1) +"]").attr("src", armoryFacepicURL + $("item[slot="+ i +"]",charXml).attr("icon") + ".png" );
						}
					};
					//alert($("item[slot=0]",charXml).attr("icon"))
				  }); 
				


			</script>



</body>
</html>
<%
Sub PlayerBaseInfo()
	Dim ltt
		sql="select * from player where id="&request("id")
		rs.open sql,conn,1,1
			if rs.bof or rs.eof then
				response.write "未知人物"
				Response.end
				Exit Sub
			Else
				player_name=rs("player_name")
				base_dkp=BaseDKP(rs("id"),1)
			%>
			<div class="ArmoryCharFrame outframe">
				<a class="face" href="http://cn.wowarmory.com/character-sheet.xml?r=<%=Server.URLEncode(GuildServer)%>&n=<%=Server.URLEncode(player_name)%>"><img src="images/icon/charnoface.gif" alt="" /></a>
				<dl>
					<dt><%=rs("player_name")%> &lt;<span name="GuildName">GuildName</span>&gt;</dt>
					<dd><span class="level">??</span> <span class="xclass">unknow</span> <span class="talent">?/?/?</span> <span class="skill1">Skill1</span> <span class="skill2">Skill2</span></dd>
					<dd>HP<span class="hp">-----</span> MP<span class="mp">-----</span></dd>
					<dd class="equip">
			<img name="eq1" src="images/icon/empty.png" alt="" /><img name="eq2" src="images/icon/empty.png" alt="" /><img name="eq3" src="images/icon/empty.png" alt="" /><img name="eq4" src="images/icon/empty.png" alt="" /><img name="eq5" src="images/icon/empty.png" alt="" /><img name="eq6" src="images/icon/empty.png" alt="" /><img name="eq7" src="images/icon/empty.png" alt="" /><img name="eq8" src="images/icon/empty.png" alt="" /><img name="eq9" src="images/icon/empty.png" alt="" /><img name="eq10" src="images/icon/empty.png" alt="" /><img name="eq11" src="images/icon/empty.png" alt="" /><img name="eq12" src="images/icon/empty.png" alt="" /><img name="eq13" src="images/icon/empty.png" alt="" /><img name="eq14" src="images/icon/empty.png" alt="" /><img name="eq15" src="images/icon/empty.png" alt="" /><img name="eq16" src="images/icon/empty.png" alt="" /><img name="eq17" src="images/icon/empty.png" alt="" /><img name="eq18" src="images/icon/empty.png" alt="" />
					</dd>
				</dl>
			</div>
			<%

				response.write "<table class='BaseInfo outframe'>"
				response.write "<tr><th colspan='3'><div class='title' name='"&rs("player_name")&"'>"&propic(rs("player_profession"))&rs("player_name")&" ["&rs("player_state")&"]</div><div class='filter'>"&selectplayer(rs("player_profession"))&"</div></th></tr>"
				response.write "<tr><td>职业:"&rs("player_profession")&"</td><td>职位:"&rs("player_guildlevel")&"</td><td>最近活动:"&time_type(rs("player_lastraid"),3)&"</td></tr>"
				response.write "<tr class='b'><td>种族:"&rs("player_tribe")&"</td><td>军衔:"&rs("player_honor")&"</td><td>出场:"&rs("player_raidnum")&"次</td></tr>"
				response.write "</table>"
				player_log=rs("player_log")
			end if
		rs.close
End Sub

Sub Looted()
	Dim tlooted
	Sql="select * from raid_event where event_class='拾取' and event_object='"&request("id")&"'"
	rs.open sql,conn,1,1
				response.write "<table class='lootlist outframe'><tr><th><div class='title'><img src='images/icon/box.jpg' >战利品</div></th></tr><tr class='coltitle'><td>这里显示的物品只包括了活动中拾取事件所得物品，从特殊事件购买或个人事件分配到的没有列出。</td></tr><tr><td>" 'rs("event_object2")
		if rs.bof or rs.eof then
			response.write "未获得过装备"
		else
			for i = 1 to rs.recordcount
				response.write "<div class='item'><div class='dkp'>"&rs("event_dkp")&"</div>"&eqpic(rs("event_object2"),rs("event_object2_tooltip"))&"<div class='itemname'>"&delItemID(rs("event_object2"))&"</div><div class='link'><a href='raid_report.asp?id="&rs("event_raidid")&"'>查看活动</a> <a href='looted_detail.asp?keyword="&rs("event_object2")&"'>查看物品</a></div><div class='time'>"&rs("event_time")&"</div></div>"
				tlooted = tlooted & "|"&rs("event_object2")
				rs.movenext
			Next
		end if
				response.write "</td></tr></table>"
	rs.close
	'更新Player表的Looted字段
	conn.execute("update player set player_looted='"&tlooted&"' where id="&request("id"))
End Sub

Sub PlayerDetail()
	dim ttext , arrRC(), arrRCid()
	sql="select * from raid_class order by id"
	rs.open sql,conn,1,1
	redim arrRC(rs.recordcount-1)
	redim arrRCid(rs.recordcount-1)
	for i = 0 to UBound(arrRC)
	arrRC(i)=rs("class_name")
	arrRCid(i)=rs("id")
	rs.movenext
	next
	rs.close
	'活动记录
	for zi = 0 to UBound(arrRC)
		rol1=rol1& "<th>"&raidclassText(arrRCid(zi))&"</th>"
		rol2=rol2& "<td><b>"&totaldkp(request("id"),arrRCid(zi))&"</b></td>"
		rol3=rol3& "<td><a class='abtn' href='dkplist_"&arrRCid(zi)&".html'>积分表</a></td>"
		ttext=null
	Next
	Response.write "<table class='dkpview outframe interlace'>"
	Response.write "<tr>"&rol1&"</tr>"&"<tr>"&rol2&"</tr>"&"<tr>"&rol3&"</tr>"
	Response.write "</table>"

	'活动日志
	sql="select * from raid where (raid_player like ""% "&request("id")&",%"" or  raid_player like """&request("id")&",%"" or raid_player like ""% "&request("id")&""")order by raid_actiontime desc"
	rs.open sql,conn,1,1
		if rs.eof or rs.bof then
			ttext=ttext& "<tr><td>未参加</td></tr>"
		Else
			Response.write "<div class='outframe' style='overflow:auto;height:300px;'><table >"
			for i = 1 to rs.recordcount
				sql="select * from raid_event where event_raidid="&rs("id")&" and event_class='职务任命' and event_object='"&request("id")&"'"
				rs2.open sql,conn,1,1
				If rs2.eof Or rs2.bof Then
					Response.write "<tr class='"&linec(i)&"'><td>"&time_type(rs("raid_actiontime"),11)&" 参加<a href='raid_report.asp?id="&rs("id")&"'>"&rs("raid_name")&"</a>活动.</td></tr>"
				Else
					Response.write "<tr class='"&linec(i)&"'><td>"&time_type(rs("raid_actiontime"),11)&" 参加<a href='raid_report.asp?id="&rs("id")&"'>"&rs("raid_name")&"</a>活动,并任"&rs2("event_object2")&".</td></tr>"
				End If
				rs2.close
			rs.movenext
			next
			Response.write "</table></div>"
		end if
	rs.close  

End Sub

Sub SpecEvent()
		sql="select * from raid_event where event_object='"&player_name&"' or event_object like '%|"&player_name&"|%' order by event_time desc"
		rs.open sql,conn,1,1
			if rs.eof or rs.bof then
				ttext=ttext&"<tr><td colspan='5'>没有特殊事件</td></tr>"
			else
				ttext=ttext&"<tr class='coltitle'><td>日期</td><td>DKP分类</td><td>事件</td><td>对象</td><td>分数</td></tr>"
				for i = 1 to rs.recordcount
					ttext=ttext&"<tr class='"&linec(i)&"'><td>"&time_type(rs("event_time"),3)&"</td><td>"&raidclassText(rs("raid_class"))&"</td><td>"&rs("event_class")&"</td><td>"&rs("event_object2")&"</td><td>"&rs("event_dkp")&"</td></tr>"
				rs.movenext
				next
			end if
		rs.close
		ttext="<table class='outframe'><tr><th colspan='5'><div class='title'><img src='images/icon/clock.jpg' >调分事件</div></th></tr>"&ttext&"</table>"
			Response.write ttext
			if not isNull(player_log) then Response.write "<table class='outframe'><tr><th>归档的调分事件</th></tr><tr><td><ul class='interlace'>"&player_log&"</ul></td></tr></table>"
End Sub


sub playerlist(s)
	sql="select * from player where "&s&" order by player_name"
	rs.open sql,conn,1,1
		if rs.bof or rs.eof then
		else	
			if s="1=1" then 
				response.write "<h4>全部成员</h4>"
			else
				response.write "<h4>"&rs("player_profession")&"</h4>"
			end if
			Response.write "<table class='playerlist'>"
			Response.write "<tr><th>姓名</th><th>职务</th><th>种族职业</th><th>入会时间</th><th>最后一次参与</th></tr>"
			for i = 1 to 9999
				Response.write "<tr class='"&linec(i)&"'><td>"&rs("player_name")&"</td><td>"&rs("player_guildlevel")&"</td><td>"&rs("player_tribe")&rs("player_profession")&"</td><td>"&rs("player_jointime")&"</td><td>"&time_type(rs("player_lastraid"),3)&"</td></tr>"
				rs.movenext
				if rs.eof then exit for
			next
			Response.write "</table>"
		end if
	rs.close
end sub




function act2view(act)
	dim temp
	'dead cold normal hot crazy

	'活跃度=最近10场的参加次数x3+最近10场的报名次数+DKP/(入会天数+1)/10
	'单场DKP=(全程分+迟到+请假+渎职+客串+加入后离线前掉落装备数量x装备分+加入后离线前推倒BOSSx推倒奖励+加入后离线前开荒BOSS数量x开荒奖励)x职务加成x主治疗加成x主坦克加成x指挥加成
	temp="normal"
	
end function

function showdkp(pid,rid)
	sql="select top 1 * from dkplist where playerid="&pid&" and raidid="&rid
	rs2.open sql,conn,1,1
		if rs2.eof or rs2.bof then
			showdkp="活动已归档"
		else
			showdkp=cPre(rs2("dkp"))
			tdkp=tdkp+rs2("dkp")
		end if
	rs2.close
end function

function totaldkp(pid,c)
	sql="select * from player_dkp where player_id="&pid&" and raid_class="&c
	rs2.open sql,conn,1,1
		if rs2.bof or rs2.eof then
		totaldkp="从未结算过"
		else
		totaldkp=cPre(rs2("player_dkp"))
		end if
	rs2.close
end function

function selectplayer(pro)
	stext=stext& "<form method='post' action=''><select name='filter' onChange='javascript:submit();'>"
	stext=stext& "<option value=''>选择同职业</option>"
sql="select * from player where player_profession='"&pro&"' order by player_name"
rs3.open sql,conn,1,1
	if rs3.eof or rs3.bof then
	stext=stext& "<option value='Warrior'>444</option>"
	else
		for il= 1 to rs3.recordcount
	stext=stext& "<option value='"&rs3("id")&"'>"&rs3("player_name")&"</option>"
		rs3.movenext
		next
	end if
	stext=stext& "</select></form>"
rs3.close
selectplayer=stext
end function
%>